<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta http-equiv="Cache-Control" content="no-cache" />
        <title>{yun:}$title{/yun} - {yun:}$config.sy_webname{/yun}</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width" initial-scale="1" />
        <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=2.0, user-scalable=no, width=device-width" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/css.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/job.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/css/map.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
        <link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/mui/css/mui.min.css?v={yun:}$config.cachecode{/yun} " type="text/css" />
    </head>

    <body>
        <header>
            <div class="header">
                <div class="header_bg {yun:}if $tplmoblie.color{/yun}bg{yun:}$tplmoblie.color{/yun}{yun:}/if{/yun}">
                    <a class="hd-lbtn" href="javascript:history.back();"><i class="header_top_l"></i></a>
                    <div class="header_map">{yun:}$title{/yun}</div>
                </div>
            </div>
        </header>

        <div class="yun_map_tit">
            <ul>
                <li class="yun_map_cur">
                    <a href="{yun:}url m=wap c=map x=$smarty.get.x y=$smarty.get.y{/yun}">列表</a>
                </li>
                <li>
                    <a href="{yun:}url m=wap c=map a=maplist x=$smarty.get.x y=$smarty.get.y{/yun}" class="tcq_mune_msgnews_box">地图</a>
                </li>
            </ul>
        </div>
        <div id="loading">
            <i class="loading_icon"></i>
        </div>

        <!--公司-->
        <div class="" id="com">
        </div>
        <div id="pageindicator" class="pages" style="padding-bottom:20px;display:none">
			<a href="javascript:void(0)" onclick="maptoPrev()" style="color:#333">上一页</a>
			<select id="pageChange" onchange="toPages()"></select>
			<a href="javascript:void(0)" onclick="maptoNext()" style="color:#333">下一页</a>
			<em></em>
		</div>
        <div class="nearby_position" id="nocom" style="display: none;">
        	您的附近没有相关职位！
        </div>
        <script src="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/prefixfree.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/layer/layer.m.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script src="{yun:}$config.sy_weburl{/yun}/app/template/wap/js/public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
        <script type="text/javascript" src="{yun:}$config.mapurl{/yun}"></script>
        <script type="text/javascript">
            var x = parseFloat("{yun:}$config.map_x{/yun}");
            var y = parseFloat("{yun:}$config.map_y{/yun}");
            var map_tocity = "{yun:}$config.map_tocity{/yun}";
            if('{yun:}$smarty.get.x{/yun}' && '{yun:}$smarty.get.y{/yun}') {
                x = '{yun:}$smarty.get.x{/yun}';
                y = '{yun:}$smarty.get.y{/yun}';
            }
            $(window).load(function() {
                //适当延迟隐藏，提高loading效果  
                $('#loading').hide(0);
            });

            /*$(window).load(function(){
            		//为ajax绑定loading_bottom  
            		$(document).ajaxStart(function(){  
            				$("#loading").show();//在ajax请求开始的时候启用loading  
            		}).ajaxStop(function(){  
            				$('#loading').hide(0);//在ajax请求结束后隐藏loading  
            		});  
            });*/
            var res;
            var mk_list = new Array();
			var page = 1;
			var smartypage = '{yun:}$smarty.get.page{/yun}';
			if(smartypage!=''){
				page = smartypage;
			}
			var pagecount = 0;
			var prev = '';
			var next = '';
			var option = '';
            if(map_tocity == '1') {
                get_current_loaction();
            } else {
                get_com_list(x, y);
            }
			
            function get_current_loaction() {
                var geolocation = new BMap.Geolocation();
                geolocation.getCurrentPosition(function(r) {
                    if(this.getStatus() == BMAP_STATUS_SUCCESS) {
                        x = r.point.lng;
                        y = r.point.lat;
                        if('{yun:}$smarty.get.x{/yun}' && '{yun:}$smarty.get.y{/yun}') {
                            x = '{yun:}$smarty.get.x{/yun}';
                            y = '{yun:}$smarty.get.y{/yun}';
                        }
                        get_com_list(x, y);
                    } else {
                        alert('failed' + this.getStatus());
                    }
                }, {
                    enableHighAccuracy: true
                });
            }

            function get_com_list(x, y) {
                $.post('index.php?c=map&a=joblist', {
                    x: x,
                    y: y,
					page: page
                }, function(data) {
                	
                    if(data) {
                        res = eval('(' + data + ')');
                        var errourl = '{yun:}$config.sy_weburl{/yun}/{yun:}$config.sy_unit_icon{/yun}';
                        if (res.list.length > 0) {
							pagecount = res.pagecount;
							if(res.prev && res.prev!=''){
								prev=res.prev;
							}else{
								prev="";
							}
							if(res.next && res.next!=''){
								next=res.next;
							}else{
								next="";
							}
							if(res.option && res.option!=''){
								$("#pageChange").html(res.option);
							}else{
								$("#pageChange").html('');
							}
							var joblist_html='';
							for (var i = 0; i < res.list.length; i++) {
								joblist_html+='<div class="map_job_list mt10"> ';
								joblist_html+='<div class="map_job_list_box">';
								joblist_html+='<div class="map_job_top">';
								joblist_html+='<div class="map_job_topname">';
								joblist_html+='<a href="'+res.list[i].joburl+'" >'+res.list[i].name+'</a>';
								joblist_html+='</div>';
								joblist_html+='<span class="map_job_xz">'+res.list[i].salary_n+'</span>';
								joblist_html+='<div class="map_job_info"></div>';
								joblist_html+='<div class="map_job_com"><a href="'+res.list[i].comurl+'">'+res.list[i].com_name+'</a></div>';
								if(res.list[i].lastupdate){
									joblist_html+='<div class="map_job_com">更新时间：<span class="">'+res.list[i].lastupdate+'</span></div>';
								}
								if(res.list[i].welfare){
									joblist_html+='<div class="map_job_fl">';
									for (var k = 0; k < res.list[i].welfare.length; k++) {
										joblist_html+='<span class="map_job_fl_s">'+res.list[i].welfare[k]+'</span>';
									}
									joblist_html+='</div>';
								}
								joblist_html+='</div>';
								joblist_html+='</div>';
								joblist_html+='<div class="com_map"><a href="'+res.list[i].addressurl+'"><span class="com_map_name">地址</span>'+res.list[i].address+'<em>'+res.list[i].dis+'</em><i class="com_map_name_icon"></i></a></div>';
								joblist_html+='</div>';
							}
							$('#com').html(joblist_html);
							$('#pageindicator').show();
						} else {
                            $('#nocom').show();
							$('#pageindicator').hide();
                        }
						if(res.pagecount>0){
							$('#pageindicator').find('em').html('共'+res.pagecount+'页');
						}
                    }
                });
            }
			function maptoPrev(){
				if(prev!=""){
					window.location.href = prev;
				}
			}
			function maptoNext(){
				if(next!=""){
					window.location.href = next;
				}
			}
			function toPages(){
				var obj=document.getElementById("pageChange");
				window.location.href=obj.options[obj.selectedIndex].value;
			}
        </script>
        {yun:}include file="$wapstyle/footer.htm"{/yun}